package weixin

import (
	"encoding/xml"
	"fmt"
	"testing"
)

func TestMessageTextEntity(t *testing.T){
	// 序列化
	msg := MessageTextEntity{
		ToUserName: "toUser",
		FromUserName: "fromUser",
		CreateTime:   "123456789",
		MsgType:      "text",
		Content:      "Hello World",
	}
	xmlData, err := xml.MarshalIndent(msg, "", "  ")
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	fmt.Println(string(xmlData))
}